package com.xcity.pomelo.response;

import java.util.ArrayList;
import java.util.List;

import com.xcity.db.entity.Mine;
import com.xcity.game.common.EasyItemInfo;
import com.xcity.game.map.template.MineTypeTemplate;

import naga.x.net.impl.pomelo.PomeloMessage;
import naga.x.net.impl.pomelo.protocol.Message;

@PomeloMessage(type = Message.Type.RESPONSE)
public class MineUntakeResponse extends Response {

	private long ownerId;
	private int money;
	private List<EasyItemInfo> itemList;
	private int map;
	private int pos;
	private List<Long> removeList;
	public MineUntakeResponse(int serial, Mine mine, MineTypeTemplate temp, int count, List<Long> eids) {
		super(serial);
		ownerId = mine.getOwnerId();
		if(temp.getProduceGold() > 0){
			money = temp.getProduceGold() * count;
		}
		itemList = new ArrayList<EasyItemInfo>();
		for(int i = 0, size = temp.getProduceItem().length; i < size; i++){
			if(temp.getProduceItem()[i] > 0 && temp.getProduceItemCount()[i] > 0){
				itemList.add(new EasyItemInfo(temp.getProduceItem()[i], temp.getProduceItemCount()[i] * count));
			}
		}
		map = mine.getMap();
		pos = mine.getPos();
		removeList = eids;
	}
	public long getOwnerId() {
		return ownerId;
	}
	public void setOwnerId(long ownerId) {
		this.ownerId = ownerId;
	}
	public int getMoney() {
		return money;
	}
	public void setMoney(int money) {
		this.money = money;
	}
	public List<EasyItemInfo> getItemList() {
		return itemList;
	}
	public void setItemList(List<EasyItemInfo> itemList) {
		this.itemList = itemList;
	}
	public int getMap() {
		return map;
	}
	public void setMap(int map) {
		this.map = map;
	}
	public int getPos() {
		return pos;
	}
	public void setPos(int pos) {
		this.pos = pos;
	}
	public List<Long> getRemoveList() {
		return removeList;
	}
	public void setRemoveList(List<Long> removeList) {
		this.removeList = removeList;
	}
}
